﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Data;
using MyLib;
using Portal.Entity;
//using Portal.Interface;
using Portal.Logic;
using ProcessControl;
using ProcessControl.Interface;
using ProcessControl.Entity;

namespace PRProcess
{
    public partial class MROApprove : System.Web.UI.Page
    {
        ICapex capex = ServiceContainer.Instance().GetService<ICapex>();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
              
            }
            ((ButtonList)this.ButtonList1).AfterSubmit += new System.ComponentModel.CancelEventHandler(MROApprove_AfterSubmit);

        }

        void MROApprove_AfterSubmit(object sender, System.ComponentModel.CancelEventArgs e)
        {
            //更新主表Status的状态为2（1代表正在进行中的，2代表审批通过的）
            string FormID = "";
            foreach (RepeaterItem ri in fld_detail_PROC_PURCHASEREQUEST_DT.Items)
            {
                FormID = ((Label)ri.FindControl("fld_FORMID")).Text;
            }
             string strSql = "Update dbo.PROC_PURCHASEREQUEST set STATUS=2 where FORMID='" + FormID.Trim() + "'";
             DataTable dt = DataAccess.Instance("BizDB").ExecuteDataTable(strSql);
        }
        
    }
}